data AddComputedOptions = AddComputedOptions
{ computeParams :: CmdParams
, computeRemote :: DeferredParse Remote
- , reproducible :: Reproducible
+ , reproducible :: Maybe Reproducible
}
optParser :: CmdParamsDesc -> Parser AddComputedOptions
optParser desc = AddComputedOptions
<$> cmdParams desc
<*> (mkParseRemoteOption <$> parseToOption)
- <*> (fromMaybe (Reproducible False) <$> parseReproducible)
+ <*> parseReproducible
newtype Reproducible = Reproducible { isReproducible :: Bool }
, Remote.Compute.computeInputs = mempty
, Remote.Compute.computeOutputs = mempty
, Remote.Compute.computeSubdir = subdir
- , Remote.Compute.computeReproducible = isreproducible
+ , Remote.Compute.computeReproducible = False
}
fast <- Annex.getRead Annex.fast
starttime <- liftIO currentMonotonicTimestamp
| fast = do
addSymlink outputfile stateurlk Nothing
return stateurlk
- | isreproducible = do
+ | isreproducible state = do
sz <- liftIO $ getFileSize outputfile'
metered Nothing sz Nothing $ \_ p ->
ingestwith $ ingestAdd p (Just ld)
calcduration (MonotonicTimestamp starttime) (MonotonicTimestamp endtime) =
fromIntegral (endtime - starttime) :: NominalDiffTime
- isreproducible = isReproducible (reproducible o)
+ isreproducible state = case reproducible o of
+ Just v -> isReproducible v
+ Nothing -> Remote.Compute.computeReproducible state
* `--fast`
- Adds computed files to the repository, without generating their content
- yet.
+ Adds computed files to the repository, without doing any work yet to
+ compute their content.
+
+ This implies `--unreproducible`, because even if the compute remote
+ produces reproducible output, it's not available.
* `--unreproducible`, `-u`
Indicate that the computation is expected to be fully reproducible.
This is the default when the compute remote indicates that it produces
- reproducible output.
+ reproducible output (except when using `--fast`).
If a computation turns out not to be fully reproducible, then getting
the file from the compute remote will later fail with a checksum